package com.lzm.listendemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

public class SecondTestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second_test);

        Intent intent = new Intent(this, MainTestActivity.class);
        Button btn_1 = findViewById(R.id.button);
        Button btn_2 = findViewById(R.id.button2);
        btn_1.setOnClickListener(v -> {
            startActivity(intent);
        });
        btn_2.setOnClickListener(v -> {
            startActivityForResult(intent, -1);
        });
    }
}